·
<script setup>
import { ref, reactive, watch } from "vue"
const props = defineProps(['visiable'])
const emit = defineEmits(['close'])
const acWrap = ref()
const isShow = ref(false)
const form = reactive({
  cargoName: '', //货品名
  wight: "", // 重量
  weightArea: '', // 重量范围
  price: '', // 初始价格
  discount: 0.2, //折扣
  specifications: "", // 规格
  variety: "", // 品种
  descript: "", //描述
  imgs: [

  ],
  originPrice: "",
  inventoryQuantity: "",
  sort: ''
})
const close = () => {
  emit('close')
}
watch(() => props.visiable, (val) => {
  if (!val) Object.assign(form, {
    cargoName: '', //货品名
    wight: "", // 重量
    weightArea: '', // 重量范围
    price: '', // 初始价格
    discount: 0.2, //折扣
    specifications: "", // 规格
    variety: "", // 品种
    descript: "", //描述
    imgs: [

    ],
    originPrice: "",
    inventoryQuantity: "",
    sort: ''
  })
  isShow.value = val
})
</script>

<template>
  <el-dialog v-model="isShow" title="预览" width="600" @close="close">
    <div class="ac-wrap" ref="acWrap">
      <img src="./p1.png" alt="">
      <img src="./p2.png" alt="">
    </div>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="isShow = false">关闭</el-button>
      </div>
    </template>
  </el-dialog>
</template>

<style scoped>
.ac-wrap {
  width: calc(100% - 40px);
  max-height: 60vh;
  position: relative;
  background-color: #fff;
  overflow-y: scroll;
  padding: 0 20px;
}
</style>